package io.hots.config;

import io.hots.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author yueshibin@cetcbigdata.com
 * @date 2022/9/6 6:14 下午
 */

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                //拦截路径
                .addPathPatterns("/api/user/v1/create")

                //非拦截路径
                .excludePathPatterns("");
    }
}
